/*
 * @Description: 接收相关接口
 * @Author: Rfan
 * @Date: 2022-05-10 10:13:07
 * @LastEditTime: 2023-01-07 18:07:24
 */

import request from '@/utils/request';

// 分页查询接收批次列表
export function fetchBatchListByPage(data) {
  return request({
    url: `archive-receive-batch-excel/page`,
    method: 'post',
    data
  });
}

// 新增接收批次
export function addBatch(data) {
  return request({
    url: `/archive-receive-batch-excel/`,
    method: 'post',
    data
  });
}

// 确认接收在线移交
export function confirmReceive(data) {
  return request({
    url: `/archive-receive-batch-excel/do-receive`,
    method: 'post',
    data
  });
}

// 编辑接收批次
export function editBatch(data) {
  return request({
    url: `/archive-receive-batch-excel/`,
    method: 'put',
    data
  });
}

// 删除接收批次
export function deleteBatchItem(id) {
  return request({
    url: `/archive-receive-batch-excel/${id}`,
    method: 'delete'
  });
}

// 保存目录附件
export function saveFolderLevel(data) {
  return request({
    url: `/archive-receive-batch-excel/save/folder-att`,
    method: 'post',
    data
  });
}

// 保存原文规则
export function saveOriginRule(data) {
  return request({
    url: `/archive-receive-batch-excel/save/original-rule`,
    method: 'post',
    data
  });
}

// 保存原文文件
export function saveOriginFiles(data) {
  return request({
    url: `/archive-receive-batch-excel/save/original-att`,
    method: 'post',
    data
  });
}

// 开始检测任务
export function startDetectionTask(id) {
  return request({
    url: `/archive-receive-batch-excel/start-detection-task/${id}`,
    method: 'get'
  });
}

// 开始审批任务
export function startAuditTask(id) {
  return request({
    url: `/archive-receive-batch-excel/start-audit-task/${id}`,
    method: 'get'
  });
}

// 打回
export function startBackTask(id) {
  return request({
    url: `/archive-receive-batch-excel/back/${id}`,
    method: 'get'
  });
}

// 保存模板关系
export function saveTemplateRelation(data) {
  return request({
    url: `/archive-receive-batch-excel/save/folder-template-relation`,
    method: 'post',
    data
  });
}

// 查询模板列表
export function fetchTemplateList(data) {
  return request({
    url: `/template-excel/list`,
    method: 'post',
    data
  });
}

// 分页查询模板列表
export function fetchTemplateListByPage(data) {
  return request({
    url: `/template-excel/page`,
    method: 'post',
    data
  });
}
// 新增Excel模板
export function addExcelTemplate(data) {
  return request({
    url: `/template-excel/`,
    method: 'post',
    data
  });
}

// 编辑Excel模板
export function editExcelTemplate(data) {
  return request({
    url: `/template-excel/`,
    method: 'put',
    data
  });
}
// 删除模板
export function delectExcelTemplate(id) {
  return request({
    url: `/template-excel/${id}`,
    method: 'delete'
  });
}

// 查询模板级别关系列表
export function fetchTemplateLevelList(data) {
  return request({
    url: `/template-excel-level-relation/list`,
    method: 'post',
    data
  });
}

// 保存模板级别关系列表
export function saveTemplateLevelList(data) {
  return request({
    url: `/template-excel-level-relation/`,
    method: 'post',
    data
  });
}

// 删除模板级别关系列表
export function deleteTemplateLevelList(id) {
  return request({
    url: `/template-excel-level-relation/${id}`,
    method: 'delete'
  });
}

// 删除模板级别关系列表
export function uploadBatch(id) {
  return request({
    url: `/archive-receive-batch-excel/db/${id}`,
    method: 'get'
  });
}
